Upstream tarball 9480
[amule.git] / MSVC Solution / fixwxGUIDs.pl
blob145aac89032a27c9cd0d06d49517716a54c5feed
1 #!perl
3 # This script is only useful if your source is in a SVN working copy!
5 # Problem: whenever you add a new wxWidgets version and convert the VC6 projects,
6 # they are converted to VC8 XML .vcproj . In the process, a new project GUID is created.
7 # When you then open your solution, all GUIDs are updated.
9 # To avoid this:
10 # 1) Open and close wx.dsw, creating the .vcproj
11 # 2) Run this script. It will replace the new GUIDs in the wx vcproj by the old ones from the aMule-MSVCE-ExtLibs.sln .
12 # 3) Now load aMule-MSVCE-ExtLibs.sln. It won't be changed anymore.
15 use strict;
17 open(sln, 'aMule-MSVCE-ExtLibs.sln');
18 #Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxregex", "..\..\wxWidgets\build\msw\wx_wxregex.vcproj", "{B4ACF599-824F-4806-8390-414B2DF64922}"
19 while (<sln>) {
20 if (/^Project.*, \"(.+)\", (\".+\")/) {
21 my ($path, $guid) = ($1, $2);
22 next unless $path =~ /\\wxWidgets/;
23 print "fix $path\n";
24 open(prj, $path) or die;
25 my @content = <prj>;
26 close prj;
27 foreach (@content) {
28 if (/ProjectGUID=/) {
29 $_ = "\tProjectGUID=$guid\n";
30 last;
33 open(prj, ">$path") or die;
34 print prj @content;
35 close prj;